<template>
  <div class="classgrop select-wrap">
    <h4 class="grop-title">Util sDFO sdf123</h4>
    <ul class="c-list whilt">
      <router-link class="c-list-i" :to="'/student/12123sdf'" tag="li" v-for="item in list" :key="item.id" exact>
        <div class="avatar-wrap"><span class="userhead" :style="'background-image:url(' + item.userhead + ')'"></span></div>
        <div class="username-wrap vux-1px-b">{{item.username}}</div>
        <span class="link yellow">90分 <x-icon type="ios-arrow-right" size="16"></x-icon></span>
      </router-link>
    </ul>
    <toast v-model="err" type="text" :text="errtxt"></toast>
  </div>
</template>

<script>
  import { Toast } from 'vux'
  export default{
    components: { Toast },
    data() {
      return {
        list: [],
        err: false,
        errtxt: ''
      }
    },
    created() {
      let req = {
        id: this.$route.params.id
      }
      this.$http.post('/studentslist', req).then(res => {
        if (res.body.error_code) {
          this.err = true
          this.errtxt = error_msg
          return
        }
        this.list = res.body.res.list
      })
    }
  }
</script>

<style lang="less">
  .whilt {
    background: #fff;
  }

  .grop-title {
    font-size: 18px;
    text-align: center;
    padding: 6px 14px 20px;
  }

  .c-list-i {
    position: relative;
    .link {
      position: absolute;
      right: 14px;
      top: 0;
      font-size: 15px;
      svg {
        vertical-align: -3px;
        fill: #a9a9a9;
      }
    }
  }
</style>
